<?php 
/**
 * 测试号码插入
 */

$link = mysql_connect ( 'localhost', 'root', '');
if (! $link) {
	die ( 'Could not connect: ' . mysql_error () );
}
mysql_query ( "SET NAMES utf8", $link );

for($i=1; $i<=20000; $i++){
	$query = "INSERT INTO `test`.`users` (`uin`, `name`, `created`) VALUES (NULL, '芭芭拉_{$i}', CURRENT_TIMESTAMP);";
	mysql_query ( $query, $link );	
	echo "插入+{$i}<br />\t\n";
}
mysql_close ( $link );


function randomkeys($length)
   {
       $pattern = '1234567890abcdefghijklmnopqrstuvwxyz
                   ABCDEFGHIJKLOMNOPQRSTUVWXYZ,./&amp;l
                  t;&gt;?;#:@~[]{}-_=+)(*&amp;^%$£!';    //字符池
      for($i=0; $i<$length; $i++)
       {
           $key .= $pattern{mt_rand(0,35)};    //生成php随机数
       }
       return $key;
   }
   echo randomkeys(8);
?>